package com.hadluo.qq.server;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

/**
 * QQ聊天服务端启动类
 * @author hadluo
 */
@SpringBootApplication
@MapperScan("com.hadluo.qq.server.mapper")
public class QQServerApplication {

    public static void main(String[] args) {
        SpringApplication.run(QQServerApplication.class, args);
    }

    /**
     * 注入ServerEndpointExporter，自动注册使用了@ServerEndpoint注解的bean
     */
    @Bean
    public ServerEndpointExporter serverEndpointExporter() {
        return new ServerEndpointExporter();
    }
}